﻿// Copyright (c) 2013, Simon Carter.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted 
// provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this list of 
//   conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice, this list of 
//  conditions and the following disclaimer in the documentation and/or other materials provided 
//  with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// History
// Initial Release - Simon Carter
//

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace ErrorManager.ErrorClient
{
    /// <summary>
    /// Current Processing Stage
    /// </summary>
    public enum ProcessStage { Initialising, BuildingSystemInformation, ContactingServer, ConnectionRefused, LoggingIn, LoggedIn, LoginFailed, SendingErrorInformation, SendingExtraInformation, SendingFile, FileSent, SendingSystemInfo, SystemInfoSent, Disconnecting, Error, TimeOut, Waiting, ConfirmingReceiptOfData, ReceiptConfirmed, Complete }

    /// <summary>
    /// Progress Event Arguments
    /// </summary>
    public class ProgressEventArgs
    {
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="stage"></param>
        /// <param name="information"></param>
        public ProgressEventArgs(ProcessStage stage, string information = "")
        {
            Stage = stage;
            Information = information;
        }

        /// <summary>
        /// Current Process Stage
        /// </summary>
        public ProcessStage Stage
        {
            get;
            private set;
        }

        /// <summary>
        /// Information relevant to current Stage
        /// </summary>
        public string Information
        {
            get;
            private set;
        }
    }

    /// <summary>
    /// Progress Event Delegate
    /// </summary>
    /// <param name="sender">Current Sender</param>
    /// <param name="e">Progress Event Arguments</param>
    public delegate void ProgressHandler(object sender, ProgressEventArgs e);

    /// <summary>
    /// Additional Files
    /// </summary>
    public class AdditionalFilesEventArgs
    {
        /// <summary>
        /// Constructor
        /// </summary>
        public AdditionalFilesEventArgs()
        {
            Files = new List<string>();
        }

        /// <summary>
        /// List of Files to be sent to the ErrorServer
        /// </summary>
        public List<string> Files { get; set; }
    }

    /// <summary>
    /// Additional Files Event Delegate
    /// </summary>
    /// <param name="sender">Additional Files to be sent</param>
    /// <param name="e"></param>
    public delegate void AdditionalFilesHandler(object sender, AdditionalFilesEventArgs e);

    /// <summary>
    /// Class representing additional information
    /// </summary>
    public class AdditionalInformationEventArgs
    {
        /// <summary>
        /// Additional Information sent to the server
        /// </summary>
        public string Information { get; set; }
    }

    /// <summary>
    /// Additional information Event Delegate
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public delegate void AdditionalInformationHandler(object sender, AdditionalInformationEventArgs e);
}
